﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Sockets;
using System.Linq;
using System.Runtime.Serialization.Json;
using System.Text;
using ServiceHost1;

namespace SocketTestClient
{
    class Program
    {
        static void Main(string[] args)
        {
            //var client = new TcpClient("pi", 1515);

            //NetworkStream ns = client.GetStream();

            //var message = "Hello " + DateTime.Now.TimeOfDay;
            //ns.Write(Encoding.Default.GetBytes(message),0, message.Length );

            //var data = new byte[1024];
            //int recv = ns.Read(data, 0, data.Length);

            //Console.WriteLine(Encoding.Default.GetString(data,0,recv));

            //MemoryStream stream = new MemoryStream(data,0,recv);
            //TestModel person;

            //DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(TestModel));
            //person = (TestModel)ser.ReadObject(stream);

            //Console.Write("Person name: {0}, surname: {1}", person.name, person.surname);
            //foreach (string s in person.lista)
            //{
            //    Console.Write(", {0}",s);
            //}
            //Console.WriteLine();
            //Console.ReadLine();
        }
    }
}
